-- Viral Resistance - T-Engine 4 Module
-- Copyright (C) 2010 Mikolai Fajer
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Mikolai Fajer "yufra"
-- mfajer@gmail.com

local Object = require "mod.class.Object"

defineTile('>', 'DOWN')
defineTile('<', 'UP')
defineTile('#', 'WALL')
defineTile('*', 'WALL', nil, 'EMERGENCY_LIGHT', nil, nil, {type="light", subtype="emergency"})
defineTile('.', 'FLOOR')
defineTile('o', 'WINDOWED_DOOR')
defineTile('O', 'WINDOWED_DOOR_LOCKED', nil, nil, nil, {type="exit", "outdoors"})
defineTile('+', 'WOODEN_DOOR')
defineTile('L', 'WOODEN_LOCKED')
defineTile('=', 'DESK')
defineTile('B', 'BED')
defineTile('T', 'OPERATING_TABLE')

-- Add the stairs
addSpot({31, 1}, 'stairs', 'a')
addSpot({33, 1}, 'stairs', 'b')
addSpot({64, 1}, 'stairs', 'c')
addSpot({66, 1}, 'stairs', 'd')
addSpot({31, 37}, 'stairs', 'e')
addSpot({33, 37}, 'stairs', 'f')
addSpot({64, 37}, 'stairs', 'g')
addSpot({66, 37}, 'stairs', 'h')

-- Add the elevator doors and buttons
defineTile('E', 'ELEVATOR_DOOR')
local button = Object.new{
	name="Elevator Button",
	desc=[[A panel of buttons.]],
	display='x', color=colors.SLATE,
	can_talk = "elevator",
	show_tooltip=true,
	type = "button", subtype="button",
}
defineTile('e', 'WALL', button)

-- Add signs
local newSign = function(tooltip)
	return Object.new{show_tooltip=true, tooltip=tooltip, name='sign', display='?', color=colors.GREY}
end
defineTile('1', 'WALL', newSign("Operating Room 1"))
defineTile('2', 'WALL', newSign("Operating Room 2"))
defineTile('3', 'WALL', newSign("Operating Room 3"))
defineTile('4', 'WALL', newSign("Operating Room 4"))
defineTile('5', 'WALL', newSign("Operating Room 5"))
defineTile('6', 'WALL', newSign("Operating Room 6"))
defineTile('7', 'WALL', newSign("Operating Room 7"))
defineTile('8', 'WALL', newSign("Operating Room 8"))
defineTile('9', 'WALL', newSign("Operating Room 9"))
defineTile('R', 'WALL', newSign("#RED#Emergency Room"))
defineTile('S', 'WALL', newSign("Security Station and Armoury"))
defineTile('M', 'WALL', newSign("Morgue"))
defineTile('N', 'WALL', newSign("Laboratory and Imaging"))

-- Add the closet
local closet = Object.new{
	name = "Noises",
	desc = [[You can hear some rustling from behind the door.]],
	display = 'x',
	color = colors.WHITE,
	can_talk = "lab_closet",
	show_tooltip = true,
	type = "noise", subtype = "noise",
}
defineTile('C', 'WOODEN_LOCKED', closet)

-- Add the armoury discussion
defineTile('g', 'BARRIER', nil, 'BARRIER_GUARD')
defineTile('b', 'BARRIER')
defineTile('s', 'FLOOR', nil, 'BARRIER_GUARD')

startx = 4
starty = 4
endx = 4
endy = 4

return [[
##################################################################################################
#=..==..==..=#................#.#<##############################>#<#.#.#.#.#.#=.T.T.T.=#.#.#.#.#.#
#=..==..==..=#................#.#.##############################.#.#L#L#L#L#L#=.T.T.T.=#L#L#L#L#L#
#=..==..==..=#................#...##############################...#.............................#
#............+................#...##############################...#............=====............#
#............###################o####*###########################o####M++###################++M###
#............o...................................................................................O
#=============...................................................................................O
#................................................................................................O
#.................................##S+##########################...#############N+++##############
#.................................#.bgb#....####################...#=======..#.........o....#.BB.#
#.................................*...sL....####################...#.........o.........o....#.BB.#
#.................................bs...#....####################...#=======..#..=====..#....+....#
#.................................g....*########################...#.........#..=...=..#....######
#.................................bs...#########################...#=======..#..==.==..#....+....#
#.................................*.s..######...#...############...###.......o.........#=..=#.BB.#
#..........=====..................#.bgb######...e...############...#.C.......#.........#====#.BB.#
#..........=...=..................##S+########E#*#E#############...###############################
O..........=...=...................................................R.............................#
O..........=.......................................................o.....===.=====.=====.===.....#
O..........=...=...................................................o.....=.................=.....#
#..........=...=..................###*########E#*#E#############...#.....=.................=.....#
#..........=====..................###########...e...############...#..#########################..#
#.................................###########...#...############...#..#.....o.....o.....o.....#..#
#.................................##############################...#..#..T..#..T..#..T..#..T..#..#
#.................................##############################...#..#..T..#..T..#..T..#..T..#..#
#.................................##############################...#..#.....#.....#.....#.....#..#
#.................................##############################...#..#.....#.....#.....#.....#..#
#.................................##############################...#..##8o####6o####4o####2o###..#
#.................................##############################...#.............................O
#..................................................................#.............................O
#..................................................................#.............................O
#==============L===============....................................##9o####7o####5o####3o####1o###
#.............................##o################################o##.....#.....#.....#.....#.....#
#.............................#...##############################...#.....#.....#.....#.....#.....#
######+#################+######...##############################...#..T..#..T..#..T..#..T..#..T..#
#.............................#.#.##############################.#.#..T..#..T..#..T..#..T..#..T..#
#.............................#.#<##############################.#<#.....o.....o.....o.....o.....#
##################################################################################################]]